package com.yz.design.settlement;

import lombok.Data;
import lombok.ToString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @ClassName CitySiteSettlementContext
 * @Description 城市站结算上下文
 * @Author 广长
 * @Date 2020/7/10
 * @Version V1.0
 **/
@Data
@ToString
public class CitySiteSettlementContext {
    private static Logger logger = LoggerFactory.getLogger("logs");
    /**
     * 结算城市站id
     */
    private Integer citySiteId;

    /**
     * 结算城市站类型
     */
    private String citySiteType;

    /**
     * 城市站结算服务
     */
    private ICitySiteSettlementService citySiteSettlementService;


    public CitySiteSettlementContext(Integer citySiteId, String citySiteType, ICitySiteSettlementService citySiteSettlementService) {
        this.citySiteId = citySiteId;
        this.citySiteType = citySiteType;
        this.citySiteSettlementService = citySiteSettlementService;
    }

    /**
     * @Description: 付钱
     * @Author: 广长
     * @Date: 2020/7/10
     * @Param context: 结算上下文
     * @Return: void
     */
    public void payTo(SettlementContext context) {
        logger.debug("付钱");
        this.citySiteSettlementService.payTo(context);
    }

    /**
     * @Description: 收钱
     * @Author: 广长
     * @Date: 2020/7/10
     * @Param context: 结算上下文
     * @Return: void
     */
    public void receiveFrom(SettlementContext context) {
        logger.debug("收钱");
        this.citySiteSettlementService.receiveFrom(context);
    }

    /**
     * @Description: 撤销付款
     * @Author: 广长
     * @Date: 2020/7/10
     * @Param context: 结算上下文
     * @Return: void
     */
    public void cancelPayTo(SettlementContext context) {
        logger.debug("撤销付款");
        this.citySiteSettlementService.cancelPayTo(context);
    }

    /**
     * @Description: 撤销收款
     * @Author: 广长
     * @Date: 2020/7/10
     * @Param context: 结算上下文
     * @Return: void
     */
    public void cancelReceiveFrom(SettlementContext context) {
        logger.debug("撤销收款");
        this.citySiteSettlementService.cancelReceiveFrom(context);
    }

}
